/*------------------------------轮播图------------------------------*/

var time = "";
var index = 1;
$(function() {
	showimg(index);
	//鼠标移入移出
	$(".imgnum span").hover(function() {
		clearTimeout(time);
		var icon = $(this).text();
		$(".imgnum span").removeClass("onselect").eq(icon - 1).addClass("onselect");
		$("#banner_img li").hide().stop(true, true).eq(icon - 1).fadeIn("slow");
	}, function() {
		index = $(this).text() > 4 ? 1 : parseInt($(this).text()) + 1;
		time = setTimeout("showimg(" + index + ")", 3000);
	});
});

function showimg(num) {
	index = num;
	$(".imgnum span").removeClass("onselect").eq(index - 1).addClass("onselect");
	$("#banner_img li").hide().stop(true, true).eq(index - 1).fadeIn("slow");
	index = index + 1 > 6 ? 1 : index + 1;
	time = setTimeout("showimg(" + index + ")", 3000);
}

/*------------------------------所有分类------------------------------*/
$(function() {
	function customHover(hoverEle, blockEle) {
		$(hoverEle).mouseover(function() {
			$(blockEle).css("display", "block");
		})
		$(hoverEle).mouseout(function() {
			$(blockEle).css("display", "none");
		})
	}

	customHover("#topTabBox #topTab .topCats", "#topTabBox #topTab .topCats .topCats_ul")
	customHover("#topTabBox #topTab .topCats .topCats_ul .hoverli1", "#topTabBox #topTab .topCats .blockimg1")
	customHover("#topTabBox #topTab .topCats .blockimg1", "#topTabBox #topTab .topCats .blockimg1")
})
//------------------------------------------------------------------------------个人中心
$(function() {
	$("#navNavRight .geren").mouseover(function() {
		$("#navNavRight .geren").css({"border-left":"1px solid #ccc","border-right":"1px solid #ccc","background":"#fff"});
		$("#navNavRight .geren .title").css({"border-left":"1px solid #fff"});		
		$("#navNavRight .kehu .title").css({"border-left":"1px solid #f2f2f2"});		
		$("#navNavRight .geren .zhongxin").css("display", "block");
	})
	$("#navNavRight .geren").mouseout(function() {
		$("#navNavRight .geren").css({"border-left":"1px solid #f2f2f2","border-right":"1px solid #f2f2f2","background":"#f2f2f2"});
		$("#navNavRight .geren .title").css({"border-left":"1px solid #ccc"});		
		$("#navNavRight .kehu .title").css({"border-left":"1px solid #ccc"});		
		$("#navNavRight .geren .zhongxin").css("display", "none");
	})
})



/*-------------------------跳转---------------------------*/
$(function(){
	/*var top = $("#tiaozhuan").offset().top;*/
	$(document).scroll(function(){
		if ($(window).scrollTop()>=500) {
			$("#tiaozhuan").css({"display":"block"})
		}else{
			$("#tiaozhuan").css({"display":"none"})		
		}
	})
	
	
	$("#tiaozhuan .last").click(function(){

	})
	
	
	
})

